<div style="min-height: 250px;">
    <?php
    if ($totalCost > 0) {
        $action = "https://secure.ebs.in/pg/ma/sale/pay";
    } else {
        $action = Yii::app()->createUrl('ShoppingCart/Orderdetails');
    }

    $form = $this->beginWidget('GxActiveForm', array(
        'id' => 'shoppingcartform',
        'action' => $action,
        'htmlOptions' => array('class' => 'form',
            'role' => "form")
    ));

    $secretKey = Message::SECRETKEY;
    $account_id = Message::ACCOUNT_ID;
    $amount = $totalCost;
    $refrence_no = Message::REFRENCE_NO;
    $return_url = Message::RETURN_URL;
    $mode = Message::MODE;
    $string = "$secretKey|$account_id|$amount|$refrence_no|$return_url|$mode";
    $secure_hash = md5($string);
    ?>
    <input name="account_id" type="hidden" value="<?php echo $account_id; ?>">
   
    <input name="return_url" type="hidden" value="<?php echo $return_url; ?>" />
    <input name="user_id" id="user_id" type="hidden" value="<?php echo $loginuserId; ?>" />
    <input name="email" id="user_email" type="hidden" value="<?php echo $useremail; ?>" />
    <input name="name" id="user_name" type="hidden" value="<?php echo $username; ?>" />
    <input name="mode" type="hidden" size="60" value="<?php echo $mode; ?>" />
    <input name="amount" id="amount" type="hidden" value="<?php echo $amount; ?>"/>
    <input name="reference_no" type="hidden" value="<?php echo $refrence_no; ?>" />
    <input name="description" type="hidden" value="test test test" /> 
    <input name="address" type="hidden" maxlength="255" value="new delhi" />
    <input name="city" type="hidden" maxlength="255" value="new delhi" />
    <input name="state" type="hidden" maxlength="255" value="new delhi" />
    <input name="postal_code" type="hidden" maxlength="255" value="110022" />
    <input name="country" type="hidden" maxlength="255" value="356" />
    <input name="phone" type="hidden" maxlength="255" value="9878766554" />
    <input name="ship_name" type="hidden" maxlength="255" value="Hari" />
    <input name="ship_address" type="hidden" maxlength="255" value="New Delhi" />
    <input name="ship_city" type="hidden" maxlength="255" value="New Delhi" />
    <input name="ship_state" type="hidden" maxlength="255" value="New Delhi" />
    <input name="ship_postal_code" type="hidden" maxlength="255" value="110034" />
    <input name="ship_country" type="hidden" maxlength="255" value="356" />
    <input name="ship_phone" type="hidden" maxlength="255" value="9878766554" />
    <input name="secure_hash" type="hidden" value="<?php echo $secure_hash; ?>" />
    <?php $this->endWidget(); ?>
</div>

<script>
    window.onload = function() {
        document.forms['shoppingcartform'].submit()
    }
</script>